<?php
if (!defined('EXPONENT')) exit('');
  global $db;
  $obj = null;
  $id = 0;
  
  if (exponent_permissions_check(array("administrate", "manage"),$loc)) 
  {
      if(isset($_REQUEST['id']))
      {
         $id = intval($_REQUEST['id']); 
      }
      $obj = $db->selectObject('maillinglist','id='.$id);
      if (isset($obj->id))
      {
          if ($obj->blacklist == 1)
            $obj->blacklist = 0;
          else
            $obj->blacklist = 1;
          $db->updateObject($obj,'maillinglist','id='.$id);
          exponent_flow_redirect();
      }
  }
?>
